<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <include file="Inc/basic_css"/>
    <include file="Inc/basic_js"/>
    <import type="js" basepath="__JS__" file="admin" />
    <style>
        #ClassAdd{width:97%; margin:0 auto; display:none;}/* height:1px; overflow:hidden; */
        #class_title{ padding:10px 0;}
    </style>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN HEADER -->
<include file="Inc/head"/>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container">
    <!-- BEGIN SIDEBAR -->
    <include file="Inc/left"/>
    <!-- END SIDEBAR -->
    <!-- BEGIN PAGE -->
    <div class="page-content">
        <!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
        <!-- BEGIN STYLE CUSTOMIZER -->
        <include file="Inc/theme"/>
        <!-- END BEGIN STYLE CUSTOMIZER -->
        <!-- BEGIN PAGE HEADER-->
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                <h3 class="page-title">
                    Mip站广告管理 <small></small>
                </h3>
                <ul class="page-breadcrumb breadcrumb">
                    <li><i class="fa fa-home"></i><a href="{:U('Index/index')}">首页</a> <i class="fa fa-angle-right"></i></li>
                    <li><a href="#">广告系统</a><i class="fa fa-angle-right"></i></li>
                    <li><a href="#">Mip站广告管理</a></li>
                </ul>					<!-- END PAGE TITLE & BREADCRUMB-->
            </div>
        </div>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet-body">

                    <div role="grid" class="dataTables_wrapper form-inline">
                        <!-- /.row -->
                        <div class="table-scrollable" id="listArea" style="border:0px;">
                            <if condition="$adminLock gt 0">
                                <form method="post" name="myform" id="myform">
                                    <input type="hidden" name="parentid" value="{:I('parentid',0)}" />
                            <table class="table table-striped table-bordered table-advance table-hover">

                                <thead>
                                <if condition="$parentid gt 0">
                                <tr>
                                    <th align="center"><i class="fa fa-briefcase"></i> 广告位名称</th>
                                    <th align="center"><i class="fa fa-user"></i> 广告位说明</th>
                                    <th align="center"><i class="fa fa-shopping-cart"></i> 展现形式</th>
                                    <th align="center"><i class="fa fa-clock-o"></i> 下级位置</th>
                                    <th align="center"><i class="fa fa-picture-o"></i> 广告数量</th>
                                    <th align="center"><i class="fa fa-edit"></i> 管理操作</th>
                                </tr>
                                    <else />
                                    <th align="center"><i class="fa fa-briefcase"></i> 广告位名称</th>
                                </if>
                                </thead>
                                <tbody>
                                <foreach name="list" item="item">

                                    <if condition="$parentid gt 0">
                                        <tr>
                                            <td height="36" align="center" ><a href="{:U('Atm/index?class_id='.$item['id'])}" title="{$item.class_name}">{$item.class_name}</a></td>
                                            <td align="center" >{$item.content}</td>
                                            <td align="center" >{$showType[$item['show_id']]['show_name']}</td>
                                            <td align="center" >
                                                <if condition="$item['is_child'] && 2 gt $item['depth']+1">
                                                    <a href="{:U('AtmClass/index?parentid='.$item['id'].'')}" class="c-green">查看下级</a>
                                                    <else/>
                                                    <span class="c-Grey">暂无</span>
                                                </if>
                                            </td>
                                            <td align="center" >{$item.atm_count}</td>
                                            <td align="center" >

                                                <if condition="$item.parent_id gt 0">
                                                    <a href="{:U('Atm/index?class_id='.$item['id'])}" title="图片管理">图片管理</a>
                                                    <else/>
                                                    --
                                                </if>
                                            </td>
                                        </tr>

                                        <else />

                                        <tr>
                                            <a href="{:U('AtmClass/index?parentid='.$item['id'].'')}" title="{$item.class_name}" class="c-green"><td height="36" align="center" ><a href="{:U('AtmClass/index?parentid='.$item['id'].'')}" title="{$item.class_name}" class="c-green">{$item.class_name}</a></td></a>
                                        </tr>
                                    </if>
                                </foreach>
                                </tbody>
                            </table>
                                </form>
                            <else />
                                <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#dddddd">
                                    <tr>
                                        <th align="center"><i class="fa fa-briefcase"></i> ID</th>
                                        <th align="center"><i class="fa fa-user"></i> 模块名称</th>
                                        <th align="center"><i class="fa fa-shopping-cart"></i> 模块页面名称</th>
                                        <th align="center"><i class="fa fa-clock-o"></i> 排序</th>
                                        <th align="center"><i class="fa fa-clock-o"></i> 状态</th>
                                        <th align="center"><i class="fa fa-clock-o"></i> 管理操作</th>
                                    </tr>
                                    <foreach name="list" item="item">
                                        <tr>
                                            <td align="center"height="36">{$item.id}</td>
                                            <td align="center" >{$item.module_name}</td>
                                            <td align="center" >{$item.module_key}</td>
                                            <td align="center" class="TextTd" name="list_order" rel="{$item.id}" isfresh="1" para="input">{$item.list_order}</td>
                                            <td align="center" >
                                                <select class="form-control" name="status" rel="{$item.id}" isfresh="0" para="select">
                                                    <foreach name="statusArr" item="items" key="key">
                                                        <option value="{$key}" <if condition="$key eq $item.status && $item.status neq ''"> selected </if> class="select_color_{$key}">{$items}</option>
                                                    </foreach>
                                                </select></td>
                                            <td align="center" >
                                                <a rel="{:U('Pc/del?id='.$item['id'].'')}" onclick="Confirm_ajax($(this).attr('rel'),'确认要删除么？');" class="btn btn-xs red btn-removable"><i class="fa fa-times"></i>删除</a>
                                            </td>
                                        </tr>
                                    </foreach>
                                </table>
                            </if>
                        </div>
                        <div class="row" id="pageArea">
                            {$page}
                        </div>
                    </div>

                </div>
            </div>
        </div>

        <!-- END PAGE CONTENT -->
    </div>

</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<include file="Inc/foot"/>
<!-- END FOOTER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->

<script src="__JS__/app.js" type="text/javascript"></script>
<script src="__JS__/AjaxList.js.php?action=ajaxlistinput&url={:urlencode(U('AtmClass/ajaxListInput'))}"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
    jQuery(document).ready(function() {
        App.init(); // initlayout and core plugins
    });
    $('.classLevel').each(function(index, element) {
        var i = $(this).children('p').attr('class');
        var i = i.substring(5,7);
        $(this).children('p').css({'margin-left':16*i+'px'});
    });
</script>

<!-- END PAGE LEVEL SCRIPTS -->

</body>
<!-- END BODY -->
</html>